using Avalonia.Controls;
using SharpWebview.Content;
using SharpWebview;

namespace Ava.Demo.Views
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            //using ()
            //{
            //    //webview
            //    //    .SetTitle("The Hitchhicker")
            //    //    .SetSize(1024, 768, WebviewHint.None)
            //    //    .SetSize(800, 600, WebviewHint.Min)
            //    //    .Navigate(new UrlContent("https://en.wikipedia.org/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy_(novel)"))
            //    //    .Run();
            //    //var browserWrapper = this.FindControl<Decorator>("browserWrapper");
            //    //browserWrapper.Child = webview;
            //}
            var webview = new Webview();
            webview
                .SetTitle("The Hitchhicker")
                .SetSize(1024, 768, WebviewHint.None)
                .SetSize(800, 600, WebviewHint.Min)
                .Navigate(new UrlContent("https://www.baidu.com"))
                .Run();
            ccWeb.Content = webview;
        }
    }
}